Skip to main content

Serialization Framework

Introduction

What is serialization?

In computing, serialization is the process of translating a data structure or object state into a format that can be stored (for example, in a file or memory data buffer) or transmitted (for example, across a computer network) and reconstructed later (possibly in a different computer environment). From wikipedia

Why is it important?

In/out interfaces

As stated by wikipedia, the main use case for serialization is for data exchange, especially in the case of web services.

Internal use

eWam uses Gold which is a strongly typed language. Having types brings a lot of values to the internal to the stability of your system architecture via for example:

  • code completion
  • consistency checking

However it comes at a cost of flexibility:

  • how to support different an API versioning

The serialization can be used internally to give you that flexibility.

Implementation

The serialization framework is used to transform the objects into a data tree and reciprocally.

But also transform your application objects (record, instances) from/to text:

  • object > aDataDocument > aStringDocument
  • aStringDocument > aDataDocument > object

The serialization framework is base on:

  • a flexible intermediate representation (the data tree model)
  • a JSON parser and generator
  • Serialization/Deserialization of data tree

See also Serialization tutorial and Custom serialization tutorial